{%include file="index.header.tpl.php"%}
{%include file="index.left.tpl.php"%}
  <!--主要内容开始-->
<div class="content-wrapper">
    <section class="content">
        <div class="row">
            <section class="col-lg-2 connectedSortable" style="padding-right:0px;">
                <form action="" method="post">
                <div class="box box-solid">
                    <div class="box-header with-border">
                        <label>选择科目</label>
                        <div class="form-group" style="padding-left:10px; height:120px; overflow-y:scroll; margin-bottom:30px;">
                            <label><input type="radio" name="subject_id" value="all"> 总分</label><br/>
                            {%foreach from=$subject_lists key=key item=value%}
                            <label><input type="radio" name="subject_id" value="{%$value.subject_id%}"> {%$value.subject_name%}</label><br/>
                            {%/foreach%}
                        </div>

                    </div>
                </div><!--box box-solid-->
                <div class="box box-solid">
                    <div class="box-header with-border">
                        <label>选择年级</label>
                        <div class="form-group class" style="height:100px; overflow-y:scroll;" id="number3">

                            <label><input type="checkbox" name="allChecked" id="allChecked" onclick="DoCheck()"> 全选 </label><br/>
                            {%foreach from=$grade_lists key=key item=value%}
                            <label><input type="checkbox" name="grade_id[]" value="{%$value.grade_id%}"> {%$value.grade_name%} </label><br/>
                            {%/foreach%}
                        </div>
                        <button type="submit" class="btn btn-primary btn-sm">确 定</button>
                    </div>
                </div><!--box box-solid-->
                </form>
            </section>
            <section class="col-lg-10 connectedSortable">
                <div class="box box-default box-solid">
                    <form action="" method="get">
                        <div class="box-header with-border">
                            <span class="fa fa-step-forward" style="float:left; font-size:18px; padding-top:3px; color:#3c8dbc;" ></span>
                            <p class="box-title">学科成绩质量跟踪</p>
                            <a href="" class="btn btn-warning btn-sm" style="float:right;">导 出</a>
                        </div>
                        <div class="box-body">
                            <div class="col-md-6 col-xs-12 form-group" style="padding:0;">
                                <label class="col-sm-1 control-label text-right">
                                    从
                                </label>
                                <div class="input-group col-md-5" style="float:left;">
                                    <select class="form-control" id="semester_id" name="semester_id1">
                                        <option value="0">-请选择-</option>
                                        {%foreach from=$semester_lists key=key item=value%}
                                        <option value="{%$value.semester_id%}">{%$value.semester_name%}</option>
                                        {%/foreach%}
                                    </select>
                                </div>
                                <span style="float:left; font-weight:bold;">  至 </span >
                                <div class="input-group col-md-5" >
                                    <select class="form-control" id="semester_id" name="semester_id2">
                                        <option value="0">-请选择-</option>
                                        {%foreach from=$semester_lists key=key item=value%}
                                        <option value="{%$value.semester_id%}">{%$value.semester_name%}</option>
                                        {%/foreach%}
                                    </select>
                                </div>
                            </div>
                            <div class="col-md-3 form-group">
                                <div class="input-group col-sm-8 col-xs-8" style="float:left; margin-right:8px;">
                                    <select class="form-control"  name="exam_type">
                                        {%foreach from=$exam_type_ini key=key item=value%}
                                        <option value="{%$key%}">{%$value%}</option>
                                        {%/foreach%}
                                        <option value="all">全部考</option>
                                    </select>
                                </div>

                                <input type="hidden" name="a" value="score.folsubject">
                                <button type="submit" class="btn btn-primary">查 询</button>
                            </div>
                            <div style="clear:both; height:10px;"></div>
                            <h4 class="text-center">考试成绩一览表</h4>
                            <table class="table table-bordered"  id="mytable">
                                <thead>
                                <tr>
                                    <td>学科</td>
                                    <td>班级</td>
                                    <td>当前科任</td>
                                    <td>平均分</td>
                                    <td>级排名</td>
                                    <td>原科任</td>
                                    <td>平均分</td>
                                    <td>级排名</td>
                                </tr>
                                </thead>
                                {%foreach from=$class_lists key=key item=value%}
                                <tr>
                                    <td>{%$subject_name%}</td>
                                    <td>{%$value.class_name%}</td>
                                    <td>{%$value.teacher%}</td>
                                    <td>{%$value.score%}</td>
                                    <td>{%$value.rank%}</td>
                                    <td>{%$value.teacher2%}</td>
                                    <td>{%$value.score2%}</td>
                                    <td>{%$value.rank2%}</td>
                                </tr>
                                {%/foreach%}

                            </table>

                        </div><!--box-body -->
                        <div class="box-footer text-center">

                    </form>
                </div><!--box box-default box-solid-->
            </section>
        </div><!--row-->
    </section>
</div>
  <!--主要内容结束-->
{%include file="index.footer.tpl.php"%}
<script>
    //checbox全选
    function DoCheck()
    {
        var ch=document.getElementsByName("grade_id[]");
        if(document.getElementsByName("allChecked")[0].checked==true)
        {
            for(var i=0;i<ch.length;i++)
            {
                ch[i].checked=true;
            }
        }else{
            for(var i=0;i<ch.length;i++)
            {
                ch[i].checked=false;
            }
        }
    }
</script>

<script src="static/js/jquery.canvasjs.min.js"></script>
<script type="text/javascript">
    $(function () {
        $(".chartContainer").CanvasJSChart({
            title: {
                text: "考试排名趋势",
                fontSize: 16
            },
            axisX: {
                gridColor: "Silver",
                tickColor: "silver",
                interval: 10,
            },
            toolTip: {
                shared: true
            },
            data: [
//                {
//                    showInLegend: true,
//                    name: "语文",//科目
//                    type: "line",
//                    markerType: "square",
//                    dataPoints: [
//                        { x: 10, label: "高一上学期", y: 112 },//考试名称    排名
//                        { x: 20, label: "高一下学期", y: 120 },
//                        { x: 30, label: "高二上学期", y: 108 },
//                        { x: 40, label: "高二下学期", y: 90 },
//                        { x: 50, label: "高三上学期", y: 99 },
//                        { x: 60, label: "高三下学期", y: 140 },
//                    ]
//                },{
//                    showInLegend: true,
//                    name: "数学",
//                    type: "line",
//                    dataPoints: [
//                        { x: 10, label: "高一上学期", y: 126 },
//                        { x: 20, label: "高一下学期", y: 130 },
//                        { x: 30, label: "高二上学期", y: 100 },
//                        { x: 40, label: "高二下学期", y: 120 },
//                        { x: 50, label: "高三上学期", y: 99 },
//                        { x: 60, label: "高三下学期", y: 120 },
//                    ]
//                },{
//                    showInLegend: true,
//                    name: "英语",
//                    type: "line",
//                    dataPoints: [
//                        { x: 10, label: "高一上学期", y: 138 },
//                        { x: 20, label: "高一下学期", y: 120 },
//                        { x: 30, label: "高二上学期", y: 90 },
//                        { x: 40, label: "高二下学期", y: 105 },
//                        { x: 50, label: "高三上学期", y: 120 },
//                        { x: 60, label: "高三下学期", y: 130 },
//                    ]
//                },{
//                    showInLegend: true,
//                    name: "名次",
//                    type: "line",
//                    dataPoints: [
//                        { x: 10, label: "高一上学期", y: 12},
//                        { x: 20, label: "高一下学期", y: 23 },
//                        { x: 30, label: "高二上学期", y: 34 },
//                        { x: 40, label: "高二下学期", y: 19 },
//                        { x: 50, label: "高三上学期", y: 20 },
//                        { x: 60, label: "高三下学期", y: 5 },
//                    ]
//                },
                {%foreach from=$subject_lists key=key item=value%}
        {
            showInLegend: true,
                name: "{%$value.subject_name%}",//科目
            type: "line",
            markerType: "square",
            dataPoints: [
            {%foreach from=$all key=k item=v name=foo%}
            { x: {%$smarty.foreach.foo.iteration%}0, label: "{%$v.exam%}", y: {%$v.sub[$value.subject_id].rank%} },//考试名称    排名
            {%/foreach%}

        ]
        },
        {%/foreach%}
            ]
        });
    });
</script>
